﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoGenTool.Helpers
{
    public static class CodeGenerateHelper
    {
        ///<summary>创建 using 部分块。</summary>
        public static string CreateUsingsBlock(IEnumerable<string> namespaces)
        {
            var sb = new StringBuilder();
            foreach (var namespaceItem in namespaces)
            {
                sb.AppendLine($"using {namespaceItem};");
            }
            return sb.ToString();
        }

        ///<summary>创建简单的代码文件路径。</summary>
        public static string CreateGenCodeFileName(string namespaceName, string className)
        {
            return $"/{namespaceName.Replace('.', '/')}/{className}.gen.cs";
        }

    }
}
